<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>像素生存者 - Pixel Survivor</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            background: #000;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            font-family: 'Courier New', monospace;
            touch-action: none;
            user-select: none;
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            overflow: hidden;
        }

        #gameContainer {
            border: 2px solid #333;
            position: relative;
            max-width: 100vw;
            max-height: 100vh;
        }

        #gameContainer canvas {
            max-width: 100%;
            max-height: 100%;
            display: block;
        }

        /* 移动端适配 */
        @media (max-width: 800px) {
            #gameContainer {
                border: none;
                width: 100vw;
                height: 100vh;
                max-width: 100vw;
                max-height: 100vh;
            }
        }

        /* 触摸控制区域 */
        #touchControls {
            position: fixed;
            bottom: 20px;
            right: 20px;
            display: none;
            z-index: 1000;
        }

        @media (max-width: 800px) {
            #touchControls {
                display: block;
            }
        }

        .touch-button {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.3);
            border: 2px solid rgba(255, 255, 255, 0.8);
            color: white;
            font-size: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 10px;
            cursor: pointer;
            user-select: none;
        }

        .touch-button:active {
            background: rgba(255, 255, 255, 0.5);
        }
    </style>
</head>

<body>
    <div id="gameContainer"></div>
    
    <!-- 移动端触摸控制 -->
    <div id="touchControls">
        <div class="touch-button" id="upgradeBtn">🔧</div>
        <div class="touch-button" id="pauseBtn">⏸️</div>
    </div>
    
    <script src="phaser.min.js"></script>
    
    <!-- 工具模块 -->
    <script src="src/utils/EffectSystem.js"></script>
    <script src="src/utils/TouchController.js"></script>
    
    <!-- 系统模块 -->
    <script src="src/systems/WeaponSystem.js"></script>
    <script src="src/systems/EnemySystem.js"></script>
    <script src="src/systems/UpgradeSystem.js"></script>
    <script src="src/systems/AchievementSystem.js"></script>
    <script src="src/systems/ShopSystem.js"></script>
    
    <!-- UI模块 -->
    <script src="src/ui/UISystem.js"></script>
    <script src="src/ui/MenuScenes.js"></script>
    
    <!-- 主游戏场景 -->
    <script src="src/core/PixelSurvivor.js"></script>
    
    <!-- 核心模块 -->
    <script src="src/core/SpriteCreator.js"></script>
    <script src="src/core/GameConfig.js"></script>
    
    <!-- 游戏启动 -->
    <script>
        const game = new Phaser.Game(GameConfig.config);
    </script>
</body>

</html>